//
// Created by gogoqiu on 2021/9/23.
//

#include "MyTagApp.h"
#define APP_TAG "SHOULD BE OVERRIDE!"

//super.OnInit();
bool MyTagApp::OnInit(){
    SetSettingId( APP_TAG );
    //激活对象
    frame = new BaseSettingsFrame(nullptr, AppId );
    frame->loadAll();
    return true;
}

//sqlite use char?
void MyTagApp::SetSettingId( const wxString& appId ){
    //wxString temp = APP_TAG;
    if( appId.IsSameAs("SHOULD BE OVERRIDE!")){
        //critical error
        //原生配置未修改
        wxMessageBox( wxT("未设置应用ID，退出"), wxT("错误"), wxICON_ERROR );
        this->Exit();
    }else {
        this->AppId = APP_TAG;
    }
}

wxString MyTagApp::GetAppTag(){
    return this->AppId;
}

SettingInterface *MyTagApp::GetSettingInterface() {
    return frame;
}
